<legend style="margin-bottom:5px;line-height:30px;" >
    Informes
    <select  class="input-large" id="tipo_informe_id" name="tipo_informe_id" onchange="listarPorTipoInforme(this)" >
        <option value="0">Todos</option>
        <?php foreach ($this->tiposInformes as $tipoInforme) { ?>
            <option <?php echo $this->tipo_informe_id == $tipoInforme->getId() ? "SELECTED" : "" ?> value="<?php echo $tipoInforme->getId(); ?>">
                <?php echo $tipoInforme->getDescripcion(); ?></option>
        <?php } ?>
    </select>
    <input href="<?php echo $this->baseUrl("usuarios/ajax/formularioinformecolorbox/persona_id/{$this->cliente->getId()}") ?>" type="button" value="Nuevo Informe" class="btn btn-success btn-small pull-right nuevo_informe" /> 
</legend>
<table id="tabla_informes" class="tabla_reducida">
    <thead>
        <tr>
            <th style="width:120px;">Fecha</th><th>Comentario</th><th style="width:100px;">Tipo Informe</th>
        </tr>
    </thead>
    <tbody>
        <?php $informe = new Doctrine_Model_Entities_Informe() ?>
        <?php foreach ($this->conjInformes as $informe): ?>
            <tr>
                <td><?php echo $informe->getFecha()->format("d/m/Y") ?></td>
                <td><?php echo $informe->getComentario() ?></td>
                <td><?php echo $informe->getTipoInfome()->getDescripcion() ?></td>
            </tr>
        <?php endforeach; ?>
    </tbody>
</table>
<script type="text/javascript">
    $(document).ready(function(){
        
        $("#tabla_informes").chromatable({
            width: "100%",  
            height: "150px",
            scrolling: "yes" 
        });
        
        $(".nuevo_informe").colorbox({
            iframe:true, 
            innerWidth: "60%",
            innerHeight: "50%",
            onOpen: function () {},
            onClosed: function() {
                verListadoInformes(<?php echo $this->cliente->getId() ?>);
            }
        });
    });
    function listarPorTipoInforme(elem) {
        var tipo_informe_id = $(elem).val();
        var persona_id = '<?php echo $this->cliente->getId(); ?>';
        $.ajax({
            type: "POST",
            url: "<?php echo $this->baseUrl() ?>/usuarios/ajax/listadoinformes",
            dataType: "html",
            data: { "cliente_id" : persona_id, "tipo_informe_id": tipo_informe_id },
            success: function (data) { $("#content-informes").html(data); },
            error: function () { alert("Error"); }
        });
    }
</script>